<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta content="en" name="language">
	<title>annotate</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
	<link media="screen" href="../docutils-api.css" type="text/css" rel="stylesheet">

</head>

<body>

<div class="banner">
<img src="../images/gm-107x76.png" alt="GraphicMagick logo" width="107" height="76" />
<span class="title">GraphicsMagick</span>
<form action="http://www.google.com/search">
  <input type="hidden" name="domains" value="www.graphicsmagick.org" />
  <input type="hidden" name="sitesearch" value="www.graphicsmagick.org" />
<span class="nowrap"><input type="text" name="q" size="25" maxlength="255" />&nbsp;<input type="submit" name="sa" value="Search" /></span>
</form>
</div>


<div class="navmenu">
<ul>
  <li><a href="../index.html">Home</a></li>
  <li><a href="../project.html">Project</a></li>
  <li><a href="../download.html">Download</a></li>
  <li><a href="../README.html">Install</a></li>
  <li><a href="../Hg.html">Source</a></li>
  <li><a href="../NEWS.html">News</a> </li>
  <li><a href="../utilities.html">Utilities</a></li>
  <li><a href="../programming.html">Programming</a></li>
  <li><a href="../reference.html">Reference</a></li>
</ul>
</div>

<main id="annotate">
<h1 class="title">annotate</h1>
<p class="subtitle" id="annotate-an-image-with-text">Annotate an image with text</p>
<div class="contents topic" id="contents">
<p class="topic-title">Contents</p>
<ul class="simple">
<li><p><a class="reference internal" href="#annotateimage" id="id3">AnnotateImage</a></p></li>
<li><p><a class="reference internal" href="#gettypemetrics" id="id4">GetTypeMetrics</a></p></li>
</ul>
</div>
<section id="annotateimage">
<h1><a class="toc-backref" href="#id3">AnnotateImage</a></h1>
<section id="synopsis">
<h2>Synopsis</h2>
<pre class="literal-block">MagickPassFail AnnotateImage( <a class="reference external" href="../api/types.html#image">Image</a> *image, <a class="reference external" href="../api/types.html#drawinfo">DrawInfo</a> *draw_info );</pre>
</section>
<section id="description">
<h2>Description</h2>
<p>AnnotateImage() annotates an image with DrawInfo 'text' based on other
parameters from DrawInfo such as 'affine', 'align', 'decorate', and
'gravity'.</p>
<p>Originally this function additionally transformed 'text' using
TranslateText() but it no longer does so as of GraphicsMagick 1.3.32.</p>
<p>The format of the AnnotateImage method is:</p>
<pre class="literal-block">MagickPassFail AnnotateImage( <a class="reference external" href="../api/types.html#image">Image</a> *image, <a class="reference external" href="../api/types.html#drawinfo">DrawInfo</a> *draw_info );</pre>
<p>A description of each parameter follows:</p>
<dl class="simple">
<dt>status:</dt>
<dd><p>Method AnnotateImage returns MagickPass if the image is annotated
otherwise MagickFail.</p>
</dd>
<dt>image:</dt>
<dd><p>The image.</p>
</dd>
<dt>draw_info:</dt>
<dd><p>The draw info.</p>
</dd>
</dl>
</section>
</section>
<section id="gettypemetrics">
<h1><a class="toc-backref" href="#id4">GetTypeMetrics</a></h1>
<section id="id1">
<h2>Synopsis</h2>
<pre class="literal-block">unsigned int GetTypeMetrics( <a class="reference external" href="../api/types.html#image">Image</a> *image, const <a class="reference external" href="../api/types.html#drawinfo">DrawInfo</a> *draw_info,
                             <a class="reference external" href="../api/types.html#typemetric">TypeMetric</a> *metrics );</pre>
</section>
<section id="id2">
<h2>Description</h2>
<p>GetTypeMetrics() returns the following information for the specified font
and text:</p>
<p>o character width
o character height
o ascent
o descent
o text width
o text height
o maximum horizontal advance
o underline position
o underline thickness</p>
<p>The format of the GetTypeMetrics method is:</p>
<pre class="literal-block">unsigned int GetTypeMetrics( <a class="reference external" href="../api/types.html#image">Image</a> *image, const <a class="reference external" href="../api/types.html#drawinfo">DrawInfo</a> *draw_info,
                             <a class="reference external" href="../api/types.html#typemetric">TypeMetric</a> *metrics );</pre>
<dl class="simple">
<dt>image:</dt>
<dd><p>The image.</p>
</dd>
<dt>draw_info:</dt>
<dd><p>The draw info.</p>
</dd>
<dt>metrics:</dt>
<dd><p>Return the font metrics in this structure.</p>
</dd>
</dl>
</section>
</section>
</main>


<hr class="docutils">
<div class="document">
    <p><a href="../Copyright.html">Copyright</a> © GraphicsMagick Group 2002-2025<!--SPONSOR_LOGO--></p>
</div>

</main>
</body>
</html>
